import { defineStore } from "pinia";
import { ref, computed } from "vue";
import { listCourse } from "@/api/coursemanagement/course";
export const useCourseStore = defineStore("course", () => {
  // 课程列表
  const courseList = ref([]);
  //获取课程列表
  const getCourseList = async () => {
    const res = await listCourse();
    courseList.value = res.rows;
    console.log("测试courseList");
    console.log(courseList.value);
    return res.rows;
  };
  return {
    courseList,
    getCourseList,
  };
});
